feat(embeddings): add quota summary and TokenUsageBar card to embeddings page - #460
Open
cagedbird043 wants to merge 1 commit into
Open
feat(embeddings): add quota summary and TokenUsageBar card to embeddings page#460cagedbird043 wants to merge 1 commit into
cagedbird043 wants to merge 1 commit into
Conversation
Owner
|
Thanks. Two things before this can go in: (1) parseEmbeddingQuotaLabel hardcodes equivalences (10K neurons/day approximated as 30M tokens/mo, $0.10 as 2M tokens) inferred from quota label strings, plus a silent cloudflare default; those numbers will drift and mislead. If we can't compute a real figure from recorded usage, it's better to show the quota label as-is. (2) TokenUsageBar is imported from FallbackPage into EmbeddingsPage; a shared component should move to components/ rather than being owned by a sibling page. Also note #459 and #457 merged, so a rebase picks up pooled scaling and key load-balancing. Happy to review a revision. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a quota summary and multi-account pooled budget card (
TokenUsageBar) to the Embeddings page, aligning its UI design with the main Models page.Changes
server/src/routes/embeddings.ts, parse quota labels (e.g. Cloudflare Neurons/day, HuggingFace monthly credits) and scale by active key count to calculatetotalBudget,totalUsed, and per-family budgets in/api/embeddings/usage.TokenUsageBarandTokenUsageDatafromFallbackPage.tsx.EmbeddingsPage.tsx, render<TokenUsageBar>at the top of the Embeddings tab when total budget is available.